// the vertex normal and vector from world vertex to light location
varying vec3 N, L;

attribute float	ssaoFactor;

varying	float	ssaoFactorV;
  
void main() {
	// std position transform  
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;  
	
	// calculate normal
	N = gl_NormalMatrix * gl_Normal; 
	
	// vertex in world space
	vec4 V = gl_ModelViewMatrix * gl_Vertex;  
	
	// use light 0 
	L = gl_LightSource[0].position.xyz - V.xyz; 
	 
	gl_FrontColor = gl_Color;
	
	ssaoFactorV = ssaoFactor; 
}
